package com.dragon.sso.dto;

import java.util.Collection;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

@Data
public class CustomUserDetail implements UserDetails {

  private String username;
  private String password;
  private String displayName;
  private String phone;
  private String type;

  public CustomUserDetail() {
  }

  public CustomUserDetail(String username, String password, String displayName, String phone,
      String type) {
    this.username = username;
    this.password = password;
    this.displayName = displayName;
    this.phone = phone;
    this.type = type;
  }

  @Override
  public Collection<? extends GrantedAuthority> getAuthorities() {
    return null;
  }

  @Override
  public String getPassword() {
    return password;
  }

  @Override
  public String getUsername() {
    return this.username;
  }

  @Override
  public boolean isAccountNonExpired() {
    return true;
  }

  @Override
  public boolean isAccountNonLocked() {
    return true;
  }

  @Override
  public boolean isCredentialsNonExpired() {
    return true;
  }

  @Override
  public boolean isEnabled() {
    return true;
  }
}
